package cz.semjobKB.search.impl;

import cz.semjobKB.conllx.api.IWord;
import cz.semjobKB.search.api.IMatch;

/**
 * Class represents one match of a rule in the sentence
 */
public class Match implements IMatch {

	IWord word;
	String ruleName;
	boolean vassalage;
	int sentenceNumber;
	int positionOfTheRoot;

    /**
     * Constructor
     * @param match         Match
     * @param ruleName      Rule name
     * @param vassal        Is match minor(false), larger true
     * @param position      Position of the root word of this match
     * @param sentenceNo    Sentence position in the document
     */
	public Match(IWord match, String ruleName, boolean vassal, int position, int sentenceNo) {
		this.word = match;
		this.ruleName = ruleName;
		this.vassalage = vassal;
		this.positionOfTheRoot = position;
		this.sentenceNumber = sentenceNo;
	}
	
	
	public String getMatch() {
		return word.getText(); 
	}

	
	public int getPositionRootMatch() {
		return positionOfTheRoot;
	}

	
	public String getRuleName() {
		return ruleName;
	}

	
	public boolean isVassal() {
		return vassalage;
	}

	
	public int sentenceNumber() {		
		return 0;
	}

	
	public IWord getMatchWord() {		
		return word;
	}

}
